package com.ciwong.epaper.modules.evaluate.ui.dialogfragment;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.ciwong.epaper.R;
import com.ciwong.epaper.modules.evaluate.ui.dialogfragment.adapter.BaseDFrgAdapter;
import com.ciwong.epaper.modules.evaluate.ui.dialogfragment.adapter.CheckReReadDFrgAdapter;
import com.ciwong.epaper.modules.evaluate.ui.dialogfragment.bean.CheckReReadBean;
import com.ciwong.epaper.modules.evaluate.ui.dialogfragment.viewholder.CheckReReadDFrgViewHolder;
import com.ciwong.mobilelib.utils.ToastUtil;

import java.util.ArrayList;


/**
 * description：//底部弹窗
 * author：loco
 * email：lzh838330255@163.com
 * date：on 2018/3/26
 */


public class CheckReReadDialogFragment extends BaseDialogFragment<CheckReReadBean> {
    public static final int ITEM_ZERO = 0;//第0个条目
    public static final int ITEM_FIRST = 1;//第一个条目
    public static final int ITEM_TOW = 2;//第一个条目
    public static final int ITEM_THREE = 3;//第一个条目
    public static final int ITEM_FOUR = 4;//第一个条目
    public static final int ITEM_FIVE = 5;//第一个条目

    public  final String ITEM_NAME_ZERO = "第零条";//第零条目
    public  final String ITEM_NAME_FIRST = "第一条";//第一个条目
    public  final String ITEM_NAME_TOW = "第二条";//第二个条目
    public  final String ITEM_NAME_THREE = "第三条";//第三个条目
    public  final String ITEM_NAME_FOUR= "第四条";//第四个条目
    public  final String getITEM_NAME_FIVE= "第五条";//第四个条目

    private RecyclerView rvFragmentDialog;
    private CheckReReadDFrgAdapter checkReReadDFrgAdapter;

    @Override
    protected void initData() {
        if (list==null){
            list=new ArrayList();
        }
    }

    @Override
    int setView() {
        return R.layout.dialog_bottom;
    }

    @Override
    void initView(View view) {
        rvFragmentDialog = view.findViewById(R.id.rv_bottom_dialog);
        view.findViewById(R.id.tl_close).setOnClickListener(this);

        checkReReadDFrgAdapter = new CheckReReadDFrgAdapter(getContext());
        rvFragmentDialog.setAdapter(checkReReadDFrgAdapter);
        rvFragmentDialog.setLayoutManager(new LinearLayoutManager(getContext()));

        checkReReadDFrgAdapter.setData(list);
        checkReReadDFrgAdapter.setCheckItemListener(new BaseDFrgAdapter.ICheckItemListener<CheckReReadDFrgViewHolder,CheckReReadBean>() {
            @Override
            public void checkItem(CheckReReadDFrgViewHolder holder, CheckReReadBean bean, int position) {

                ToastUtil.INSTANCE.toastCenter(getContext(),"位置："+position);
            }
        });
    }

    @Override
    void onClick(int resID) {
         if (resID == R.id.tl_close) {
            dismiss();
        }
    }
}
